import React,{useState, useEffect} from "react";


function HooksPage () {

    const [title, setTitle] = useState('useEffect');
    useEffect(() => {
        setTimeout(() => {
            setTitle('变化后的useEffect')
        }, 3000)
    }, [])
    return (<div>
        <h3>{title}</h3>
        <textarea className="form-control" rows={10}>
            {`useEffect(() => {
            setTimeout(() => {
                setTitle('变化后的useEffect')
            }, 3000)
        }, [])`}
        </textarea>

    </div>)
}

export default HooksPage